<!DOCTYPE html>
<html>
<head>
    {include file="layout:_meta" /}
</head>
<body>

<div class="layui-form"  style="padding: 20px 30px 0 0;">
    <div class="layui-form-item">
        <label class="layui-form-label">角色名称</label>
        <div class="layui-input-block">
            <input type="text" name="title" lay-verify="required" placeholder="请输入角色名称"  value="{:isset($list.title)?$list.title:''}" autocomplete="off" class="layui-input">
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">说明描述</label>
        <div class="layui-input-block">
            <textarea type="text" name="des" placeholder="请说明描述角色（可不填）" autocomplete="off" class="layui-textarea">{:isset($list.des)?$list.des:''}</textarea>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">审核状态</label>
        <div class="layui-input-block">
            {if condition="(isset($list.state)&&$list.state==1)||!isset($list.state)"}
            <input type="checkbox" lay-filter="state"  checked value="1" name="state" lay-skin="switch" lay-text="通过|待审核">
            {else /}
            <input type="checkbox" lay-filter="state"  value="0" name="state" lay-skin="switch" lay-text="通过|待审核">
            {/if}
        </div>
    </div>
    <div class="layui-form-item layui-hide">
        <input type="hidden" name="id" value="{:isset($list['id'])?$list['id']:''}">
        <input type="button" lay-submit lay-filter="addEdit" id="addEdit" value="确认">
    </div>
</div>
{include file="layout:_footer" /}
<script>
    layui.use(['form'], function(){
        var form = layui.form,$ = layui.$;

        form.on('switch(state)', function(data){
            this.value = this.checked?1:0;
        });
    })
</script>
</body>
</html>
